<!DOCTYPE html>
<html lang="en">
<head>
    <title>地图导航定位</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <style rel="stylesheet" type="text/css">
        /*去除正文区域内外的间距：全屏*/
        body{margin:0; padding:0;}
        /*地图加载容器的大小:全屏*/
        #container{
            width: 100%;
            height: 100vh;
        }
    </style>
</head>
<body>
<!--
    注册高德平台账号：https://lbs.amap.com
    开发手册：https://lbs.amap.com/api/javascript-api-v2/summary
    创建应用，创建key
-->

<!--地图呈现容器-->
        <div id="container"></div>

<script type="text/javascript">
    window._AMapSecurityConfig = {
      securityJsCode: "35d641f1599b042e4e5ca52af276cf6d",
    };
</script>
<!--加载官方地图脚本：请附加申请的key-->
<script
        type="text/javascript"
        src="https://webapi.amap.com/maps?v=2.0&key=c8f4d397ea1fac754c8265fe228ef5d1"
></script>
<script type="text/javascript">


    var map = new AMap(
        'container',
        {
            zoom: 18,
            center: [113.660219,34.800367]
        }
    )


    window.onload = function(){
       //调用鸿蒙端，代理注册过来的函数，设置定位点
       map.setZoomAndCenter(20,[lon,lat])

       var marker = new AMap.Marker({
           map,
           icon:"https://webapi.amap.com/theme/v1.3/markers/n/mark_b.png"
           position:[lon,lat]
       })

       //加入到地图中
       map.add(marker)
    }



</script>



   </body>
</html>